home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1452 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.4 KB

  1. Path: newsfeed.internetmci.com!xmission!news
  2. From: tknarr@xmission.com  ( Todd Knarr )
  3. Newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.lang.eiffel
  4. Subject: Re: Hungarian notation
  5. Date: 11 Jan 1996 03:56:00 GMT
  6. Organization: Chaos Central
  7. Message-ID: <4d21og$iab@news.xmission.com>
  8. References: <30C40F77.53B5@swsbbs.com> <marnoldDJEvtJ.1Lx@netcom.com> <4aleun$jlk@ns.RezoNet.NET> <marnoldDJMDBG.CFz@netcom.com> <4asnkr$7b0@solutions.solon.com> <4ath75$e7i@barnacle.iol.ie> <4b4kij$svt@news.microsoft.com> <dewar.819489496@schonberg> <4bd <4cf8hf$8fe@hopi.gate.net> <4cgq30$c0v@weck.brokersys.com> <4cvu68$2jb@macaw.cyberport.com>
  9. Reply-To: tknarr@xmission.com ( Todd Knarr )
  10. NNTP-Posting-Host: slc92.xmission.com
  11. X-Newsreader: IBM NewsReader/2 v1.2
  12.  
  13. In <4cvu68$2jb@macaw.cyberport.com>, tangent@cyberport.com (Warren Young) writes:
  14. >This is one of the reasons HN is useful.  By forcing the programmer to
  15. >visit every place that the variable is used, the programmer has an
  16. >opportunity to check the semantics of the variable's use.  If the type
  17. >of the variable has changed, chances are that the semantics have
  18. >changed as well.  How many times have you changed a variable's type to
  19. >fix something, only to break something else?
  20.  
  21. I find this is false in practice. In general, when I change the declared
  22. type of a variable, I'm doing the equivalent of changing an int to a long.
  23. The result of that in the presence of HN is a massive amount of monkey-work
  24. to visit and change every occurrence of the variable when the only reason
  25. for the change is to replace iCount with lCount and nothing more. Since I
  26. hate doing manual typographic changes like that and it can be difficult or
  27. impossible to write a script to do it automatically in all files involved,
  28. I find most often that it does not get done ( and I can't really blame
  29. the people who didn't do it ).
  30.  
  31. Changes in semantics do happen, but usually as a side-effect of a major
  32. change in the fundamental way the code itself works, not as a side-effect
  33. of a simple type change. As such they require code changes completely
  34. above and beyond the variable names.
  35.  
  36. --
  37. Todd Knarr : tknarr@xmission.com      |  finger for PGP public key
  38.                                       |  Member, USENET Cabal
  39.  
  40. Seriously, I don't want to die just yet.  I don't care how
  41. good-looking they are, I! don't! want! to! die!"
  42.                                         -- Megazone ( UF1 )
  43.  
  44.